<template>
    <div class="downBox">
        <!--<v-header title="下载">-->
        <!--<span slot="left" class="back_icon"></span>-->
        <!--<span slot="right" class="title_right_infor"></span>-->
        <!--</v-header>-->
        <!--<div class="main_allScroll"></div>-->
        <!--<div class="main_allScroll">-->
        <div class="img">
            <img src="../../assets/img/down_xm.png" alt="">
        </div>
        <div class="app_name">
            <h5>铺连铺</h5>
            <span>省钱赚钱两不误</span>
        </div>
        <div class="down" @click="down">
            <img src="../../assets/img/down_ios.png" alt="" v-show="isIos">
            <img src="../../assets/img/down_android.png" alt="" v-show="!isIos">
            <div>
                <span v-show="isIos">App Store</span>
                <span>立即下载</span>
            </div>
        </div>
    </div>
    <!--</div>-->
</template>
<script>
    import share from './index.js'
    import {mapState} from 'vuex'
    export default {
        name: 'downios',
        data: function () {
            return {
                isIos: true
            }
        },
        created: function () {
            this.isIos = this.comJS.isIos() ? true : false
        },
        mounted: function () {
        },
        methods: {
            down() {
                if(this.comJS.isWeiXinOrQQ() && !this.isIos){
                    share(true)
                } else {
                    if (this.isIos) {
                        window.location.href = this.config.iosDownloadUrl;
                    } else {
                        window.location.href = this.config.androidDownloadUrl;
                    }
                }
            }
        },
        computed:mapState({config:state=>state.config})
    }
</script>
<style lang="less" scoped>
    .downBox {
        background-image: url('../../assets/img/down_back.png');
        background-size: contain;
        background-repeat: no-repeat;
    }

    .img {
        margin: 0.56rem auto 0.3rem;
        img {
            display: block;
            width: 1.92rem;
            margin: 0 auto;
            &:last-of-type {
                margin-top: 0.3rem;
                width: 2.34rem;
            }
        }
    }

    .down {
        width: 3.64rem;
        height: 0.84rem;
        border: 1px solid #BA9152;
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 0 auto;
        img {
            display: block;
            width: 0.44rem;
            margin-right: 0.1rem;
        }
        div {
            span {
                color: #BA9152;
                font-size: 0.24rem;
                line-height: 0.36rem;
                display: block;
                &:last-of-type {
                    font-size: 0.26rem;
                }
            }
        }
    }
    .app_name{
        text-align: center;
        h5{
            font-weight: normal;
            font-size: 0.48rem;
            line-height: 0.66rem;
            margin-bottom: 0.1rem;
        }
        span{
            font-size: 0.3rem;
            line-height: 0.6rem;
            letter-spacing: 0.2rem;
        }
        margin-bottom: 0.5rem;
    }

</style>